﻿

// USE THIS TO DISPLAY THE PANEL!
// Display the ReservationRequest in the center of the window
function showReservationRequest()
{   

    var control = document.getElementById(rrMainPanelId);

    // display the control
    control.style.display = "block";

    //get viewport's width and height
    var viewportWidth;
    var viewportHeight;
    
    if( typeof( window.innerWidth ) == 'number' ) //Non-IE
    {
        viewportWidth = self.innerWidth;
        viewportHeight = self.innerHeight;
    } 
    else //IE
    {
        viewportWidth = document.documentElement.clientWidth;
        viewportHeight = document.documentElement.clientHeight;
    }
    
    
    //get scroll offset
    var scrollOffsetY;
    var scrollOffsetX;
    
    if( typeof( window.pageYOffset ) == 'number' ) //Non-IE
    {
        scrollOffsetY = window.pageYOffset;
        scrollOffsetX = window.pageXOffset;
    } 
    else //IE
    {
        scrollOffsetY = document.documentElement.scrollTop;
        scrollOffsetX = document.documentElement.scrollLeft;
    }
    

    //get control's width and height
    var controlWidth = control.offsetWidth;
    var controlHeight = control.offsetHeight;

    //calculate position
    var controlTop = (viewportHeight/2) - (controlHeight/2) + scrollOffsetY;
    var controlLeft = (viewportWidth/2) - (controlWidth/2) + scrollOffsetX;


    //position the control
    control.style.top = controlTop+'px';
    control.style.left = controlLeft+'px';
}


// USE THIS TO HIDE THE PANEL!
// Hide the ReservationRequest panel
function hideReservationRequest()
{
    document.getElementById(rrMainPanelId).style.display = "none";
}

  
 
     
   
  